<script setup lang="ts">
import { ref } from 'vue'
import useuser from '../../composition/useUser'

const { upPassword, formPassword } = useuser()

const onSubmit = (values: string) => {}
const onClickLeft = () => history.back()
</script>

<template>
   <div>
      <van-nav-bar :title="$route.meta.title" left-text="返回" left-arrow @click-left="onClickLeft" />

      <van-form @submit="onSubmit">
         <van-cell-group inset>
            <van-field
               v-model="formPassword.oldPassword"
               name="旧密码"
               label="旧密码"
               placeholder="旧密码"
               :rules="[{ required: true, message: '请填写旧密码' }]" />
            <van-field
               v-model="formPassword.newPassword"
               type="password"
               name="新密码"
               label="新密码"
               placeholder="新密码"
               :rules="[{ required: true, message: '请填写新密码' }]" />
         </van-cell-group>
         <div style="margin: 16px">
            <van-button round block type="primary" native-type="submit" @click="upPassword"> 修改密码 </van-button>
         </div>
      </van-form>
   </div>
</template>
